<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img {
            width: 50px;
            /* 垂直对齐方式
            baseline 基线对齐
            top 上对齐
            middle 中间对齐
            bottom 下对齐 */
            vertical-align: bottom;
        }

        #d1 {
            width: 50px;
            height: 100px;
            background-color: red;
            position: absolute;
            /*z 轴值越大显示越靠前*/
            z-index: 3;
        }

        #d2 {
            width: 100px;
            height: 50px;
            background-color: green;
            position: absolute;
            z-index: 2;
        }
    </style>
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
<input type="text">
<img src="../mg.png" alt="">
</body>
</html>